# -*- coding: UTF-8 -*-
'''
@Project ：pythonProject 
@File    ：tupleDemo2.py
@Author  ：siwei
@Date    ：2023/10/11 22:28 
@other   ：str.print---->print(str)
'''
# 元组的创建方式
# 1.小括号
tuple1 = ('element1', 'element2', 'element3')
print(tuple1, type(tuple1))

# 2.元组的内置函数tuple()
tuple2 = tuple(('element1', 'element2', 'element3'))
print(tuple2, type(tuple2))

# 3.只包含一个元素的元组需要使用逗号和小括号
tuple3 = ('element')
print(tuple3, type(tuple3))  # 不加逗号,就是str类型
tuple4 = ('element',)
print(tuple4, type(tuple4))  # 加了逗号,就是元组

# 4.空元组
tuple5 = ()
tuple6 = tuple()
print(tuple5, type(tuple5))
print(tuple6, type(tuple6))

